<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>风控统计</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
    <script type="text/javascript">
		function checkSubmit(){
			if(dateCheck()){
				$("#queryAccountStaList").attr("action","<%=basePath%>/windControllSta/queryAccountStaList.ct");
				$("#queryAccountStaList").submit();
			}else{
				return false;
			}			
			
		}
		
		function exportSubmit(){
			if(dateCheck()){
				$("#queryAccountStaList").attr("action","<%=basePath%>/windControllSta/exportAccountStaList.ct");
				$("#queryAccountStaList").submit();
			}else{
				return false;
			}			
	    }
		
		
		function dateCheck(){
			var startDate = $("#startDate").val();
			var endDate = $("#endDate").val();
			var today = $("#today").val();
			if(!startDate||!endDate){
				alert("请选择时间");
				return false;
			}
			if(startDate > endDate){
				 alert("起始时间应大于终止时间，请重新选择");
				 $("#endDate").val('');
				 $("#endDate").focus();
				return false;
			}
			if(endDate > today||startDate > today){
				 alert("选择时间应不大于当前系统时间，请重新选择");
				 $("#endDate").val('');
				 $("#startDate").val('');
				 $("#startDate").focus();
				return false;
			} 
			if(startDate < today&&endDate==today){
				alert("查询当天不能跨时段，请重新选择");
				 $("#endDate").val('');
				 $("#startDate").val('');
				 $("#startDate").focus();
				 return false;
			}
			if(startDate == today&&endDate==today){
				$("#dateFlag").val("1");
			}else{
				$("#dateFlag").val("2");
			}
			return true;
		}
	</script>
</head>
<body>
<s:form id="queryAccountStaList" action="" method="post" theme="simple">
<input id="today" value="${today }" type="hidden"/>
<input id="dateFlag" type="hidden" name="searchCondition.dateFlag"/>
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">占比统计</div></td>
        </tr>

        <tr class="tb-line">
        	<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">日期：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-mini"><s:textfield id="startDate"  name="searchCondition.startDate" 
                onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" 
                />
                </label>-<label class="tb-input-mini"><s:textfield id="endDate"  name="searchCondition.endDate" 
                onfocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" 
                />
                </label><code class="asterisk">*</code>
            </td>
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">商户号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="mchtCd" name="searchCondition.mchtCd" cssClass="queryWidth" /></label>
            </td>
         </tr>
         
         
          

        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <input type="button" value="查   询" onclick="return checkSubmit();" id="queryBtnId"/>
                </label>
                <label class="tb-input-submit">
                    <s:if 
					 test="#request.asList != null && #request.asList.size>0">
					   		<input id="szPower" type="button"
							value="导 出" onclick="return exportSubmit();"/>
					   
					</s:if>
					<s:else>
					 	<input id="szPower" disabled="disabled" value="导  出" type="button" /> 
					</s:else>
                </label>
            </td>
        </tr>
        <s:if test="#request.asList != null && #request.asList.size>0">
					<tr class="tb-line">
						<td class="tb-td paging"  align="left" colspan="4"> <page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/windControllSta/queryAccountStaList.ct?currentPage=" />

						</td>
					</tr>
	</s:if>
    </tbody>
    
</table>

<div class="big-tb">
    <table class="tb" style="width: 100%;">
        <thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="26">风控统计列表</th>
            </tr>
            <tr class="tb-line bg-gray">
                		<th class="tb-th">日期</th>
						
						<th class="tb-th">32域对应省份</th>
						<th class="tb-th">32域对应城市</th>
						<th class="tb-th">商户号</th>
						<th class="tb-th">审核通过日期</th>
						<th class="tb-th">商户状态</th>
						<th class="tb-th">信用卡交易占比</th>
						<th class="tb-th">刷磁交易占比</th>
						<th class="tb-th">总交易笔数</th>
						<th class="tb-th">高风险返回码交易笔数</th>
						<th class="tb-th">高风险返回码交易占比</th>
						<th class="tb-th">总成功笔数</th>
						<th class="tb-th">总成功交易金额</th>
						<th class="tb-th">总成功交易占比</th>
						<th class="tb-th">总失败笔数</th>
						<th class="tb-th">总失败交易占比</th>
						<th class="tb-th">夜间交易成功笔数</th>
						<th class="tb-th">夜间成功交易金额</th>
						<th class="tb-th">夜间交易失败笔数</th>
						<th class="tb-th">夜间交易笔数</th>
						<th class="tb-th">夜间交易失败占比</th>
						<th class="tb-th">余额查询失败笔数</th>
						<th class="tb-th">余额查询总笔数</th>
						<th class="tb-th">余额查询交易失败占比</th>
            </tr>
        </thead>
        <tbody>
					<s:iterator value="#request.asList" status="stat" id="tft">
						<tr class="tb-line">
							<td class="tb-td"><s:property value="#tft.transDt" /></td>
							<%-- <td class="tb-td"><s:property value="#tft.routIndustryInsIdCd" /></td>
							<td class="tb-td"><s:property value="#tft.ext1Name" /></td> --%>
							<td class="tb-td"><s:property value="#tft.provCd" /></td>
							<td class="tb-td"><s:property value="#tft.cityCd" /></td>
							<td class="tb-td"><s:property value="#tft.mchtCd" /></td>
							<td class="tb-td"><s:property value="#tft.applDate" /></td>
							<td class="tb-td"><s:property value="#tft.status" /></td>
							<td class="tb-td"><s:property value="#tft.creditAccounted" /></td>
							<td class="tb-td"><s:property value="#tft.brushAccounted" /></td>
							<td class="tb-td"><s:property value="#tft.businessCount" /></td>
							<td class="tb-td"><s:property value="#tft.highReturnCount" /></td>
							<td class="tb-td"><s:property value="#tft.highRiskReturnAccount" /></td>
							<td class="tb-td"><s:property value="#tft.totalCount" /></td>
							<td class="tb-td"><s:property value="#tft.totalAmount" /></td>
							<td class="tb-td"><s:property value="#tft.totalSuccessAccount" /></td>
							<td class="tb-td"><s:property value="#tft.totalSuccessCount" /></td>
							<td class="tb-td"><s:property value="#tft.totalFailedAccount" /></td>
							<td class="tb-td"><s:property value="#tft.nightSuccessCount" /></td>
							<td class="tb-td"><s:property value="#tft.nightSuccessAmt" /></td>
							<td class="tb-td"><s:property value="#tft.nightFailedCount" /></td>
							<td class="tb-td"><s:property value="#tft.nightCount" /></td>
							<td class="tb-td"><s:property value="#tft.nightFailedAccount" /></td>
							<td class="tb-td"><s:property value="#tft.balanceQueryFailedCount" /></td>
							<td class="tb-td"><s:property value="#tft.balanceQueryCount" /></td>
							<td class="tb-td"><s:property value="#tft.balanceQueryFailedAccount" /></td>
							
						</tr>
					</s:iterator>
				</tbody>
    </table>
</div>
</s:form>

<s:if test="#request.msg !=null">
		<script language="javascript">
			alert("${request.msg}");
		</script>
	</s:if>
</body>
</html>